<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="css/login.css" />
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/login.js"></script>
   <script type="text/javascript">
      //登录功能
      $(document).ready(function () {
         $("#login").click(function () {
           var phone=$("#phone").val();
           var password=$("#password").val();
            var isChecked = $('#accept').prop('checked');
            if (isChecked) {
               $.get("user/login",{"phone":phone,"password":password},function (user) {
               if (user){
                  sessionStorage.setItem('phone',user.phone);
                  window.location.href="index.html"
               }
               else {
                  alert("登陆失败");
               }
            });}
             else {
                alert("请先勾选同意条款")
            }

         })
      });

   </script>
<title>登录</title>
</head>

<body>
<div class="header">
   <div class="mainwarp">
      <div class="logo"><a href="../../../../target/classes/public/index.html"><img src="images/log.png" /></a></div>
      <div class="welcome">欢迎登录</div>
      <div class="headerright">
         <a href="../../../../target/classes/public/index.html">返回首页</a>
      </div>
   </div>
</div>
<div class="content">
   <div class="logtype"></div>
   <div class="clear"></div>
   <div class="logoDiv">
      <div class="logoLeft">
         <div class="leftimg">
            <img src="images/log1.gif" />
         </div>
         <div class="leftcon">
            <a href="" class="a1">手机触屏版</a>
            <a href="" class="a2">Android客户端下载</a>
            <a href="" class="a3">iPhone客户端下载</a>
         </div>
      </div>
      <div class="logoRight">
         <div class="normalLogin">
            <div class="username">
               <input id="phone" type="text" placeholder="手机号"/>
            </div>
            <div class="password">
               <input id="password" type="password" placeholder="请输入密码"/>
            </div>
            <div class="autoLogo">
               <a href="password.html" class="pasd">忘记密码？</a>
            </div>
             <div class="autoLogo">
               <input type="radio" id="accept" value="true">
               <span>我已阅读并接受<a href="user_agreement.html">用户协议</a></span>
            </div>
            <div class="logobtn">
               <a id="login">登  录</a>
            </div>
            <div class="zcbtn">
               <a href="register.html">还没有账号？立即注册</a>
            </div>
         </div>
      </div>
   </div>
</div>

<div class="clear"></div>
</body>
</html>
